<?php
	include("includes/secure.php");
	if ( isset ($_POST['cli_code']) && (int) $_POST['cli_code'] > 0){
		include("includes/config.php");
		include("includes/class/case.class.php");
	
		$myCase = new MyCase();
		
		$listCasesClient = $myCase->listCasesClient($_POST['cli_code']);
		$countCasesClient = count ($listCasesClient);
		
		if ( $countCasesClient ){
			$html = '<select name="case_code" id="case_code" class="text_grv">';
			$html .= '<option value="" selected="selected" disabled="disabled">select..</option>';
			for ($i = 0; $i < $countCasesClient; $i++)
				$html .= '<option value="'.$listCasesClient[$i]->case_code.'">'.$listCasesClient[$i]->case_number.' - '.$listCasesClient[$i]->bus_name.'</option>';
			$html .= '</select>';
			echo $html;
		}
		else
			echo 0;
	}
	else
		echo -1;
?>